package com.bdqn.service;
import com.bdqn.mapper.SysUserMapper;
import com.bdqn.pojo.SysUser;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService{
    @Resource
    private SysUserMapper sysUserMapper;

    @Override
    public SysUser getAccount(String account, String password) {
        return sysUserMapper.getAccount(account,password);
    }

    @Override
    public int getCount() {
        return sysUserMapper.getCount();
    }
    @Override
    public List<SysUser> getUserList(int pageIndex, int pageSize,String queryRealName,Integer queryRoleId) {
        return sysUserMapper.getUserList(pageIndex,pageSize,queryRealName,queryRoleId);
    }

    @Override
    public int getPwd(String oldPassword, String account) {
            return sysUserMapper.getPwd(oldPassword,account);
        }

    @Override
    public int savePassword(String account, String pwd) {
        return sysUserMapper.savePassword(account, pwd);
    }


    @Override
    public int del(Integer id) {
        return sysUserMapper.del(id);
    }

    @Override
    public int getAccountC(String account) {
        return sysUserMapper.getAccountC(account);
    }

    @Override
    public boolean add(SysUser sysUser) {
        sysUserMapper.add(sysUser);
        return true;
    }

    @Override
    public SysUser getUserById(Integer roleId) {
        return sysUserMapper.getUserById(roleId);
    }

    @Override
    public boolean update(SysUser sysUser) {
        return sysUserMapper.update(sysUser);
    }
}
